package com.xianggu;


import com.xianggu.protocol.server.RpcServer;
import com.xianggu.register.LocalServeRegister;
import com.xianggu.register.RedisLocalRegister;
import com.xianggu.spring.annotation.ComponentScan;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;

/**
 * 生产者：服务提供方，需要接受网络请求并执行
 * @author chengjy
 * @date 2025/3/8
 */
@ComponentScan(paths = {"com.xianggu.common","com.xianggu"})
public class Provider {
    public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {

        // 注册feign代理对象
//        ExtensionRegistry.registerExtension(new MyExtension());
        // 进行本地注册
//        RegisterBeanCont.register(XiangGuService.class.getName() , XiangGuServiceImpl.class, null);
        // 服务注册
//        LocalServeRegister.register("Provider" , "localhost", 8080);
        RedisLocalRegister.register("Provider" , "localhost", 8080);
//        RpcServer.start( Provider.class,  "localhost", 8080);
        RpcServer.start( Provider.class,  "localhost", 8080);
    }
}
